package com.jeff.base;

import static com.thealgorithms.maths.PrimeCheck.isPrime;

/**
 * {@Description} 计算给定的范围内的素数的个数
 * {@Author} <b style="color:yellow">yaojianfeng</b> 2024/7/7 下午8:52
 */
public class PrimeNumber {
    public static void main(String[] args) {
        showPrimeNumber(1, 100);
    }


    private static void showPrimeNumber(int start, int end) {
        int count = 0;
        System.out.print("素数: ");
        for (int i = start; i < end; i++) {
            if (isPrime(i)) {
                System.out.print(i + " ");
                count++;
            }
        }
        System.out.println(" ");
        System.out.println("总个数: " + count);
    }


}
